<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 50px;
            height: 50px;
            background-color: pink;
        }
    </style>
    <script src="fastclick.js"></script>
</head>
<body>
    <div></div>
    <script>
           /* 
            fastclick:解决 移动端点击300ms 的延时问题。
                1. github 下载对应的代码
                2. 引入自己的项目
                3. 引入下面的代码
        */
        if ('addEventListener' in document) {
            document.addEventListener('DOMContentLoaded', function () {
                FastClick.attach(document.body);
            }, false);
        }

        var div = document.querySelector('div');
        div.addEventListener('click', function () {
            alert(11);
        })
    </script>
</body>
</html>